Skip to content

test: add quic teardown lifecycle tests#1

Closed
mannie-exe wants to merge 1 commit intomainfrom
quic/test-teardown-lifecycle
Closed

test: add quic teardown lifecycle tests#1
mannie-exe wants to merge 1 commit intomainfrom
quic/test-teardown-lifecycle

Conversation

@mannie-exe
Copy link
Copy Markdown

@mannie-exe mannie-exe commented Feb 28, 2026

session.close() is broken right now; handle.gracefulClose() never fires kFinishClose back to JS so await session.closed hangs forever. Tests are written to the documented contract so they'll fail on current main, which is the point. session.destroy() works fine.

Refs: nodejs#60309, nodejs#57119

nodejs#60122 covers 2.3.1, 2.3.3, and 1.2

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 28, 2026

Greptile Summary

Added comprehensive QUIC teardown lifecycle tests covering session and endpoint cleanup behaviors. Includes shared test helpers (checkQuic, defaultCerts, createQuicPair) and 17 subtests across three files:

  • test-quic-session-close.mjs (5 tests): graceful session close, promise behavior, idempotency
  • test-quic-session-destroy.mjs (5 tests): immediate session destruction with/without errors
  • test-quic-endpoint-close.mjs (7 tests): endpoint lifecycle, graceful vs forceful shutdown

Tests follow existing patterns and use proper assertions. Note: session.close() tests will fail on current main due to known bug where handle.gracefulClose() never fires kFinishClose - tests are intentionally written to spec to document expected behavior.

Confidence Score: 4/5

  • Safe to merge with awareness that session.close() tests will fail until underlying bug is fixed
  • High-quality test code following existing patterns, comprehensive coverage, and well-documented intentional test failures that specify the correct contract for future implementation fixes
  • test/parallel/test-quic-session-close.mjs - these tests will fail on current main due to known bug in session.close() implementation

Important Files Changed

Filename Overview
test/common/quic/helpers.mjs Added shared QUIC test helper utilities: checkQuic() for skipping tests when QUIC unavailable, defaultCerts() for loading test TLS credentials, and createQuicPair() for establishing connected client-server sessions with cleanup
test/parallel/test-quic-session-close.mjs Added 5 tests for session.close(): verifies promise return, idempotency, endpoint persistence, closed promise resolution, and destroyed flag. Tests written to spec but will fail on current main due to known bug
test/parallel/test-quic-session-destroy.mjs Added 5 tests for session.destroy(): verifies immediate destruction, promise resolution/rejection with/without errors, idempotency, and server-side destroy behavior
test/parallel/test-quic-endpoint-close.mjs Added 7 tests for endpoint lifecycle: close() promise behavior, idempotency, destroy() with/without errors, graceful close waiting for sessions, closed promise identity, and connection rejection after close

Last reviewed commit: 7ddd0d1

@mannie-exe
Copy link
Copy Markdown
Author

@greptileai

1 similar comment
@mannie-exe
Copy link
Copy Markdown
Author

@greptileai

Adds shared test helpers (checkQuic, defaultCerts, createQuicPair)
and 17 subtests covering session close, session destroy, and
endpoint close/destroy behavior.

session.close() hangs on current main because handle.gracefulClose()
never fires kFinishClose back to JS. Tests assert the documented
contract and will fail until that is fixed.

Refs: nodejs#60122
Refs: nodejs#60309
Refs: nodejs#57119
@mannie-exe mannie-exe force-pushed the quic/test-teardown-lifecycle branch from 7ddd0d1 to 46d7cdd Compare March 1, 2026 00:08
@mannie-exe mannie-exe closed this Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant